package com.duobaoyu.dby.supply.admin.controller.account;

import com.duobaoyu.dby.channel.adapter.enums.OperationTypeEnum;
import com.duobaoyu.dby.common.core.util.R;
import com.duobaoyu.dby.supply.admin.annotation.SupplySysLog;
import com.duobaoyu.dby.supply.admin.service.BalanceChangeInfoService;
import com.duobaoyu.dby.supply.common.biz.dto.account.BalanceInfoDTO;
import com.duobaoyu.dby.supply.common.biz.vo.account.AvailableBalanceVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 查询余额变动明细
 *
 * @author jz
 * @version 1.0
 * @date 2022/6/5 09:27
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/balance-change-info")
@Api(value = "balance-change-info", tags = "查询余额变动明细")
public class BalanceChangeInfoController {

	private final BalanceChangeInfoService balanceChangeInfoService;

	/**
	 * 查询可用余额及销量
	 */
	@GetMapping("/queryStatistics")
	@ApiOperation(value = "查询可用余额及销量", notes = "查询可用余额及销量")
	@SupplySysLog(value = "查询可用余额及销量",operationType = OperationTypeEnum.SELECT)
	public R<List<AvailableBalanceVO>> queryBalanceAndCount(BalanceInfoDTO balanceInfo) {
		return R.ok(balanceChangeInfoService.queryBalanceAndCount(balanceInfo));
	}
}
